import React, { forwardRef, useLayoutEffect, useRef } from 'react'
import styles from './index.module.less'
import ResizeObserver from 'resize-observer-polyfill';

type TProps = {
  style?: any,
  index: number,
  ref: any,
  item: any
}

const WrappedItem = React.memo<TProps>(forwardRef(({
  style,
  index,
  item,
}, ref: any) => {
  const myRef = useRef<HTMLDivElement>(null);
  return <div style={style} data-index={index} ref={myRef} className={styles.wrapItem} key={index} >{item.value}</div>;
}));

export default WrappedItem;